/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       meshloader.h
 * Author:     twoja stara
 * Created on: 2009-05-31
 *
 **********************************************************************************************************************/

#ifndef MESHLOADER_H_
#define MESHLOADER_H_

#include "meshfactory.h"
#include "../common.h"

namespace mGameEngine
{
namespace Graphics
{

/**
 * Mesh file loader.
 * Loads meshes from all supported file formats.
 */
class MeshLoader: public MeshFactory, public FileLoader
{
public:
    /**
     * Load mesh from file.
     * @param filename mesh file name to load.
     * @return loaded mesh.
     */
    static Mesh *loadMeshFromFile(const String &filename);

    /**
     * Create mesh loader with no file name specified.
     */
    MeshLoader();

    /**
     * Create mesh file loader with specified file name.
     * @param filename mesh file name to load
     */
    MeshLoader(const String &filename);

    /**
     * Destroy mesh file loader.
     */
    virtual ~MeshLoader();

    /**
     * Load mesh from file.
     */
    virtual void load();

    /**
     * Unload mesh.
     */
    virtual void unload();
};

}
}

#endif // MESHLOADER_H_
